package org.dreamwork.cai.io;

import org.dreamwork.cai.proxy.IServiceResolver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public abstract class AbstractServiceProvider implements IRemoteServiceProvider {
    private final Logger logger = LoggerFactory.getLogger (AbstractServiceProvider.class);

    protected final int CLOSING_PORT;
    protected IServiceResolver resolver;

    protected AbstractServiceProvider () {
        CLOSING_PORT  = (int) (Math.random () * 5534 + 60000);
        if (logger.isTraceEnabled ()) {
            logger.trace ("CLOSING_PORT = {}", CLOSING_PORT);
        }
    }

    public void setServiceResolver (IServiceResolver resolver) {
        this.resolver = resolver;
//        table = resolver.get (ServiceRouteTable.class);
    }
}
